function addHtmlFromXmlXsl(xmlFile, xslFile, destination) { xml = loadXMLDoc(xmlFile); xsl = loadXMLDoc(xslFile);if (window.ActiveXObject) {ex = xml.transformNode(xsl);if (destination) { destination.innerHTML = ex;}else return ex; } else if (document.implementation && document.implementation.createDocument) {xsltProcessor = new XSLTProcessor();xsltProcessor.importStylesheet(xsl);resultDocument = xsltProcessor.transformToFragment(xml, document);if (destination) { destination.innerHTML = ""; destination.appendChild(resultDocument);}else return resultDocument.firstChild.innerHTML; }}function loadXMLDoc(fname) { var xmlDoc;if (window.ActiveXObject) {xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); } else if (document.implementation && document.implementation.createDocument) {xmlDoc = document.implementation.createDocument("","",null); } else { alert('Your browser cannot handle this script'); }xmlDoc.async = false; xmlDoc.load(fname); return(xmlDoc);}
